home *** CD-ROM | disk | FTP | other *** search
/ PC Pro 2003 March / DPPCPRO0303.ISO / Components / Microsoft ASP / _SETUP.1 / ASPWizard.jar / asp / wizard / WizardViewDbList1.class (.txt) < prev    next >
Encoding:
Java Class File  |  1998-11-20  |  3.5 KB  |  77 lines

  1. package asp.wizard;
  2.  
  3. import asp.netobjects.nfx.wizard.WizardPageView;
  4. import com.sun.java.swing.ListModel;
  5. import com.sun.java.swing.table.DefaultTableModel;
  6. import com.sun.java.swing.table.TableColumnModel;
  7. import com.sun.java.swing.table.TableModel;
  8.  
  9. public class WizardViewDbList1 extends WizardViewAbstract {
  10.    public static final int COLFIELDNAME = 0;
  11.    public static final int COLFIELDLABEL = 1;
  12.    private static WizardViewAbstract _instance = null;
  13.    private WVPanelDbListFields _mainPanel;
  14.  
  15.    public static WizardViewAbstract getInstance() {
  16.       if (_instance == null) {
  17.          _instance = new WizardViewDbList1();
  18.       }
  19.  
  20.       return _instance;
  21.    }
  22.  
  23.    protected void createMainPanel() {
  24.       this._mainPanel = new WVPanelDbListFields();
  25.       this._mainPanel._btnPreview.addActionListener(new 1(this));
  26.    }
  27.  
  28.    public WVPanelBase getMainPanel() {
  29.       return this._mainPanel;
  30.    }
  31.  
  32.    public TableModel getFieldSpecTableModel() {
  33.       return this._mainPanel.getFieldSpecTable().getModel();
  34.    }
  35.  
  36.    public ListModel getFieldListModel() {
  37.       return this._mainPanel.getFieldList().getModel();
  38.    }
  39.  
  40.    public TableModel getPreviewTableModel() {
  41.       return this._mainPanel._tblPreview.getModel();
  42.    }
  43.  
  44.    private void updatePreview() {
  45.       WizardModelDbList1 model = (WizardModelDbList1)((WizardPageView)this).getModel();
  46.       model.updatePreview();
  47.    }
  48.  
  49.    public boolean getRowHasHyperlink() {
  50.       return this._mainPanel._ckbRowHasHyperlink.getModel().isSelected();
  51.    }
  52.  
  53.    public void setRowHasHyperlink(boolean value) {
  54.       this._mainPanel._ckbRowHasHyperlink.getModel().setSelected(value);
  55.    }
  56.  
  57.    public void clearPreview() {
  58.       DefaultTableModel tmPreview = (DefaultTableModel)this.getPreviewTableModel();
  59.       tmPreview.setNumRows(0);
  60.       TableColumnModel tcm = this._mainPanel._tblPreview.getColumnModel();
  61.  
  62.       for(int i = tcm.getColumnCount() - 1; i >= 0; --i) {
  63.          tcm.removeColumn(tcm.getColumn(i));
  64.       }
  65.  
  66.    }
  67.  
  68.    public void commit() {
  69.       this._mainPanel._l2tPickFields.commitChanges();
  70.    }
  71.  
  72.    // $FF: synthetic method
  73.    static void access$0(WizardViewDbList1 $0) {
  74.       $0.updatePreview();
  75.    }
  76. }
  77.